#include<bits/stdc++.h>
#define int long long 
const int mod = 998244353;
using namespace std;
int fsp(int x,int k) {
	int res = 1;
	while(k) {
		if(k&1)res = res*x%mod;
		x = x*x%mod; k >>= 1; 
	} return res;
}
int n,m,k,S;
int c[10000],res[10000];
int lc[10000],rc[10000],ans = 0;
int vis[6];
void dfs(int x) {
	if(x > n) {
		for(int i=1;i<=n;i++)
//			cout<<res[i]<<" ";cout<<"\n";
		for(int i=1;i<n;i++) {
			if(res[lc[i]] == res[rc[i]])
				return void();
		} int res1 = 0;
		memset(vis,0,sizeof(vis));
		for(int i=1;i<=S;i++) {
			if(!vis[res[c[i]]])res1 ++;
			vis[res[c[i]]] = 1;
		}
//		cout<<res1<<"\n";
		ans = (ans+fsp(res1,k));
		return void();
	}
	for(int i=1;i<=m;i++)
		res[x] = i,dfs(x+1);
} 
signed main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	cin>>n>>m>>k>>S;
	for(int i=1;i<=S;i++)
		cin>>c[i];
	for(int i=1;i<n;i++)
		cin>>lc[i]>>rc[i];
	dfs(1);
	cout<<ans;
	return 0;
 } 
